<template>
    <div class="container">
        <h3>申请贷款</h3>


        <el-table
            :data="tableData"
            border
            style="margin-top:20px;"
            ref="multipleTable"
            header-cell-class-name="table-header"
        >
           <<el-table-column prop="name" sortable label="申请人"></el-table-column>
		   <el-table-column prop="createTime" sortable label="申请时间"></el-table-column>
		   <el-table-column prop="amount" sortable label="申请金额"></el-table-column>
		   <el-table-column prop="bankName" sortable label="申请银行" width="200"></el-table-column>
		   <el-table-column sortable label="审核状态">
			   <template slot-scope="scope">
				   <div v-show="scope.row.status== 0">审核中</div>
				   <div v-show="scope.row.status== 1">已通过</div>
				   <div v-show="scope.row.status== -1">已拒绝</div>
			   </template>
		   </el-table-column>

            <el-table-column label="操作" width="150" align="center">
                <template slot-scope="scope">

                    <el-button
                        type="text"

                        @click="handleCheck(scope.$index, scope.row)"
                    >查看</el-button>
                </template>
            </el-table-column>
        </el-table>
        <el-pagination
            layout="total, prev, pager, next, jumper"
            :page-size="pagesize"
            :current-page.sync="currentPage"
            :total="total"
            @current-change="handleCurrentChange"
            style="margin-top:20px"
        ></el-pagination>
    </div>
</template>
<script>
import axios from "axios"
export default {
    data() {
        return {
            added: true,
            total: 0,
            currentPage: 1,
            pagesize: 10,
            searchName: '',
            tableData: [],
            form: {},
            idx: -1,
            id: -1,
            boxCode: '',
            boxCode1: '',

            action: ''
        };
    },
    mounted() {
        this.init();
        // this.judgmentAuthority()
    },
    methods: {

        handleCurrentChange(val) {
            this.currentPage = val;
            this.init();
        },
        init() {
			let data = {
				page:1
			}
			axios.post("https://bbgy.cpzsyun.com:82/api/control/loanInfo/findByList",data).then((res)=>{
				this.tableData = res.data.rows
				this.total = res.data.total
				for(let i = 0 ; i<this.tableData.length;i++){
					this.tableData[i].createTime = this.tableData[i].createTime.substring(0,10)
				}
			})
        },
        handleCheck(index, row) {
            this.$router.push({
                path: '/systemSetupFinance/applyLoansCheck',
                query: {
                    id: row.id
                }
            });
        },

    }
};
</script>

<style scoped lang="less">
/deep/.upload-daoru {
    background: #eee;
    .el-upload {
        border: none;
        width: auto;
        height: auto;
        border-radius: 0;
        float: right;
        margin-right: 10px;
    }
}
.el-table {
    margin-top: 20px;
}
.el-pagination {
    text-align: center;
}
.el-pagination {
    text-align: center;
}
.el-col {
    margin-bottom: 0;
}
.avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    width:180px;
    overflow: hidden;
  }

  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .el-upload--text{
      width:180px;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
</style>
